YoGridPanel = function(cm,form,info) { 
	this.limit=limit;
	this.form=form;
	var reader = new Ext.data.JsonReader({
       totalProperty:'totalProperty',
       root:'root'
    },readerInfo);
	
	this.store =  new Ext.data.Store({
        proxy: new Ext.data.HttpProxy({url:url}),
        reader: reader,
        listeners :{   
	        beforeload :{   
	            fn : function(thiz,options){   
	                Ext.apply(thiz.baseParams, form.form.getValues());    
	            }   
	        }   
    	}  
    });
	var params = {
		store:this.store,
        frame:true,
        loadMask:true,
        autoScroll:true,
        stripeRows:true,
        columnLines: true,
        autoWidth:true,
        autoHeight:true,
        title:'',
        iconCls:'icon-grid',
        renderTo: document.body,
        bbar: new Ext.PagingToolbar({
        	pageSize:limit,
        	store:this.store,
        	displayInfo:true,
        	displayMsg:'显示第{0}条到{1}条记录，一共{2}条',
        	//displayMsg:'第{1}页，共{2}页',
        	emptyMsg:"没有记录"
        }),
        viewConfig: {
            forceFit:true
        },
        cm:cm
	};
	var b = this;
	this.store.on('beforeload', function() {    //Ext.data.JsonStore读入数据之前的事件,store不需要在写baseParams,因为会覆盖掉. (每次调用都载入此函数,'load'则第一次不调用外,其余都调用).
		 Ext.apply(b.store.baseParams, b.form.form.getValues()); 
		 if (typeof parmInfos != "undefined"){
				Ext.apply(b.store.baseParams,parmInfos); 
		}
		
	});
	
	Ext.apply(params, info);
	YoGridPanel.superclass.constructor.call(this, params);
	this.gridSubmit();
};

Ext.extend(YoGridPanel, Ext.grid.GridPanel, {
	
	gridSubmit : function(){
		//this.getEl().dom.action= '${base}/action/userList'; //连接到服务器的url地址
	    //this.getEl().dom.submit();
		//
		
		var _p={start:0,limit:this.limit};
		/*if (typeof parmInfos != "undefined"){
			Ext.apply(_p, parmInfos); 
		}*/
		this.store.load({params:_p});
    },
	gridSubmitByParm : function(parms){
		//this.getEl().dom.action= '${base}/action/userList'; //连接到服务器的url地址
	    //this.getEl().dom.submit();
    	Ext.apply(this.store.baseParams, parms);    
		var _p={start:0,limit:this.limit};
		if (typeof parmInfos != "undefined"){
			Ext.apply(_p, parmInfos); 
		}
		this.store.load({params:_p});
    },
    clearStoreParams:function(){
    	this.store.baseParams = {};
    }
});

Ext.reg('yoGridpanel', YoGridPanel); 